diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99794e671..d661bd9c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,7 @@ if(WIN32)
     endif()
 endif(WIN32)
 
-set(ALLEGRO_VERSION 4.4.4)
+set(ALLEGRO_VERSION 4.4.3)
 string(REGEX MATCH "^[0-9]+[.][0-9]+" ALLEGRO_SOVERSION ${ALLEGRO_VERSION})
 
 # Mac OS X -compatibility_version.
@@ -111,10 +111,6 @@ option(WANT_EMBED
 set(FRAMEWORK_INSTALL_PREFIX "/Library/Frameworks" CACHE STRING
     "Directory in which to install Mac OS X frameworks")
 
-if(MSVC)
-    option(STATIC_RUNTIME "Use the static MSVC runtime" off)
-endif(MSVC)
-
 #-----------------------------------------------------------------------------#
 #
 # Unix platform checks
@@ -339,7 +335,6 @@ if(COMPILER_GCC)
     set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "-pg"
         CACHE STRING "profiling flags")
 endif(COMPILER_GCC)
-
 if(COMPILER_MSVC)
     set(CMAKE_C_FLAGS_PROFILE "-Gd -Ox"
         CACHE STRING "profiling flags")
@@ -347,23 +342,6 @@ if(COMPILER_MSVC)
         CACHE STRING "profiling flags")
     set(CMAKE_EXE_LINKER_FLAGS_PROFILE "-profile"
         CACHE STRING "profiling flags")
-
-    if(STATIC_RUNTIME)
-        set(CompilerFlags
-            CMAKE_CXX_FLAGS
-            CMAKE_CXX_FLAGS_DEBUG
-            CMAKE_CXX_FLAGS_RELEASE
-            CMAKE_CXX_FLAGS_RELWITHDEBINFO
-            CMAKE_C_FLAGS
-            CMAKE_C_FLAGS_DEBUG
-            CMAKE_C_FLAGS_RELEASE
-            CMAKE_C_FLAGS_RELWITHDEBINFO
-            )
-        foreach(CompilerFlag ${CompilerFlags})
-            string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
-            string(REPLACE "/MDd" "/MTd" ${CompilerFlag} "${${CompilerFlag}}")
-        endforeach()
-    endif(STATIC_RUNTIME)
 endif(COMPILER_MSVC)
 
 #-----------------------------------------------------------------------------#
diff --git a/demos/shooter/demo.c b/demos/shooter/demo.c
index bc07b80e9..1ec4cf532 100644
--- a/demos/shooter/demo.c
+++ b/demos/shooter/demo.c
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
       install_joystick(JOY_TYPE_NONE);
    }
 
-   if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
+   if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {   //GFX_AUTODETECT
       if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
          set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
          allegro_message("Unable to set any graphic mode\n%s\n",
diff --git a/docs/src/allegro._tx b/docs/src/allegro._tx
index 5df9d1640..5ec4e42b0 100644
--- a/docs/src/allegro._tx
+++ b/docs/src/allegro._tx
@@ -18,12 +18,11 @@
 @document_title=Allegro Manual
 @html_footer=Back to contents
 @rtfh=Allegro - a game programming library
-@manh="version 4.4.4 (SVN)" "Allegro" "Allegro manual"
+@manh="version 4.4.3" "Allegro" "Allegro manual"
 @mans=#include <allegro.h>
 @man_shortdesc_force1=allegro
 @man_shortdesc_force2=Allegro game programming library.
 @$\input texinfo
-@$@documentencoding ISO-8859-1
 @$@setfilename allegro.inf
 @$@settitle Allegro Manual
 @$@setchapternewpage odd
@@ -53,7 +52,7 @@
        \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
 	\/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
 				       /\____/
-				       \_/__/     Version 4.4.4 (SVN)
+				       \_/__/     Version 4.4.3
 
 
 		A game programming library.
diff --git a/docs/src/readme._tx b/docs/src/readme._tx
index 391cb8548..7f814e66b 100644
--- a/docs/src/readme._tx
+++ b/docs/src/readme._tx
@@ -31,7 +31,7 @@
        \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
 	\/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
 				       /\____/
-				       \_/__/     Version 4.4.4 (SVN)
+				       \_/__/     Version 4.4.3
 
 
 		A game programming library.
diff --git a/include/allegro/base.h b/include/allegro/base.h
index 3caa8025b..4f194169d 100644
--- a/include/allegro/base.h
+++ b/include/allegro/base.h
@@ -46,8 +46,8 @@
 
 #define ALLEGRO_VERSION          4
 #define ALLEGRO_SUB_VERSION      4
-#define ALLEGRO_WIP_VERSION      4
-#define ALLEGRO_VERSION_STR      "4.4.4 (SVN)"
+#define ALLEGRO_WIP_VERSION      3
+#define ALLEGRO_VERSION_STR      "4.4.3"
 #define ALLEGRO_DATE_STR         "2019"
 #define ALLEGRO_DATE             20190303    /* yyyymmdd */
 
diff --git a/misc/allegro-config.in b/misc/allegro-config.in
index 6415580f2..d0322724d 100644
--- a/misc/allegro-config.in
+++ b/misc/allegro-config.in
@@ -12,7 +12,7 @@
 #
 #  This is heavily based on a similar script from GTK.
 
-version=4.4.4
+version=4.4.3
 
 prefix=@prefix@
 exec_prefix=$prefix
diff --git a/misc/pkgreadme._tx b/misc/pkgreadme._tx
index 98ab68f6f..6bbc8fee4 100644
--- a/misc/pkgreadme._tx
+++ b/misc/pkgreadme._tx
@@ -12,7 +12,7 @@
        \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
 	\/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
 				       /\____/
-				       \_/__/     Version 4.4.4 (SVN)
+				       \_/__/     Version 4.4.3
 
 
 		A game programming library.
diff --git a/src/file.c b/src/file.c
index c89024c14..6cbe684dd 100644
--- a/src/file.c
+++ b/src/file.c
@@ -2065,7 +2065,7 @@ PACKFILE *pack_fopen_chunk(PACKFILE *f, int pack)
 	       return NULL;
 	    }
 	    _al_sane_strncpy(chunk->normal.passdata, f->normal.passdata, strlen(f->normal.passdata)+1);
-	    chunk->normal.passpos = chunk->normal.passdata + (long)f->normal.passpos - (long)f->normal.passdata;
+	    chunk->normal.passpos = chunk->normal.passdata + (ULONG_PTR)f->normal.passpos - (ULONG_PTR)f->normal.passdata;  //64bit   long
 	    f->normal.passpos = f->normal.passdata;
 	 }
 	 chunk->normal.flags |= PACKFILE_FLAG_OLD_CRYPT;
@@ -2188,7 +2188,7 @@ PACKFILE *pack_fclose_chunk(PACKFILE *f)
       }
 
       if ((f->normal.passpos) && (f->normal.flags & PACKFILE_FLAG_OLD_CRYPT))
-	 parent->normal.passpos = parent->normal.passdata + (long)f->normal.passpos - (long)f->normal.passdata;
+	 parent->normal.passpos = parent->normal.passdata + (ULONG_PTR)f->normal.passpos - (ULONG_PTR)f->normal.passdata;  //64bit  long
 
       free_packfile(f);
    }
diff --git a/src/fsel.c b/src/fsel.c
index 96fd796bc..ac1e17b03 100644
--- a/src/fsel.c
+++ b/src/fsel.c
@@ -933,7 +933,7 @@ int file_select_ex(AL_CONST char *message, char *path, AL_CONST char *ext, int s
    if (ugetc(get_filename(path))) {
       p = get_extension(path);
       if ((!ugetc(p)) && (ext) && (ugetc(ext)) && (!ustrpbrk(ext, uconvert_ascii(" ,;", tmp)))) {
-         size -= ((long)p - (long)path + ucwidth('.'));
+         size -= ((unsigned long long)p - (unsigned long long)path + ucwidth('.')); //64bit  long
          if (size >= uwidth_max(U_CURRENT) + ucwidth(0)) {  /* do not end with '.' */
             p += usetc(p, '.');
             ustrzcpy(p, size, ext);
diff --git a/src/glyph.c b/src/glyph.c
index b4ba535ce..e8caf0898 100644
--- a/src/glyph.c
+++ b/src/glyph.c
@@ -25,7 +25,7 @@
 #define DRAW_GLYPH(bits, size)                                               \
 {                                                                            \
    AL_CONST unsigned char *data = glyph->dat;                                \
-   unsigned long addr;                                                       \
+   unsigned long long addr;                                                       \
    int w = glyph->w;                                                         \
    int h = glyph->h;                                                         \
    int stride = (w+7)/8;                                                     \
@@ -183,7 +183,7 @@ void _linear_draw_glyph24(BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y,
  */
 void _linear_draw_glyph32(BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)
 {
-   DRAW_GLYPH(32, sizeof(int32_t));
+   DRAW_GLYPH(32, sizeof(int32_t)); //64bit int32_t
 }
 
 #endif
diff --git a/src/gsprite.c b/src/gsprite.c
index 1f0f606f3..c524bb54e 100644
--- a/src/gsprite.c
+++ b/src/gsprite.c
@@ -139,7 +139,7 @@ void _soft_draw_gouraud_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y, int c1
 	       addr = bmp_write_line(bmp, j) + x1*3;
 	       for (i=x1; i<x2; i++) {
 		  bmp_select(sprite);
-		  pixel = bmp_read24((unsigned long)(sprite->line[j-y] + (i-x)*3));
+		  pixel = bmp_read24((unsigned long long)(sprite->line[j-y] + (i-x)*3));  //64bit unsigned long
 		  bmp_select(bmp);
 		  if (pixel != MASK_COLOR_24) {
 		     pixel = _blender_func24(pixel, _blender_col_24, fixtoi(hc));
diff --git a/src/gui.c b/src/gui.c
index dfe96f616..b8a3ab48a 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -571,7 +571,7 @@ static int obj_list_cmp(AL_CONST void *e1, AL_CONST void *e2)
  */
 static int cmp_tab(AL_CONST DIALOG *d1, AL_CONST DIALOG *d2)
 {
-   int ret = (int)((AL_CONST unsigned long)d2 - (AL_CONST unsigned long)d1);
+   int ret = (int)((AL_CONST unsigned long long)d2 - (AL_CONST unsigned long long)d1);  //64bit unsigned long
 
    /* Wrap around if d2 is before d1 in the dialog array. */
    if (ret < 0)
@@ -587,7 +587,7 @@ static int cmp_tab(AL_CONST DIALOG *d1, AL_CONST DIALOG *d2)
  */
 static int cmp_shift_tab(AL_CONST DIALOG *d1, AL_CONST DIALOG *d2)
 {
-   int ret = (int)((AL_CONST unsigned long)d1 - (AL_CONST unsigned long)d2);
+   int ret = (int)((AL_CONST unsigned long long)d1 - (AL_CONST unsigned long long)d2);  //64bit unsigned long
 
    /* Wrap around if d2 is after d1 in the dialog array. */
    if (ret < 0)
diff --git a/src/guiproc.c b/src/guiproc.c
index edd284a83..898402ad6 100644
--- a/src/guiproc.c
+++ b/src/guiproc.c
@@ -1365,17 +1365,17 @@ int d_text_list_proc(int msg, DIALOG *d, int c)
 		  thisitem = (*(getfuncptr)d->dp)(i, NULL);
 		  failure = FALSE;
 
-		  if ((int)((unsigned long)d->dp3) < ustrlen(thisitem)) {
-		     for (a=0; a < (int)((unsigned long)d->dp3); a++) {
+		  if ((int)((unsigned long long)d->dp3) < ustrlen(thisitem)) {
+		     for (a=0; a < (int)((unsigned long long)d->dp3); a++) {   //64bit unsigned long
 			if (utolower(ugetat(thisitem, a)) != utolower(ugetat(selected, a))) {
 			   failure = TRUE;
 			   break;
 			}
 		     }
 
-		     if ((!failure) && (utolower(ugetat(thisitem, (int)(unsigned long)d->dp3)) == utolower(c))) {
+		     if ((!failure) && (utolower(ugetat(thisitem, (int)(unsigned long long)d->dp3)) == utolower(c))) {
 			d->d1 = i;
-			d->dp3 = (void *)((unsigned long)d->dp3 + 1);
+			d->dp3 = (void *)((unsigned long long)d->dp3 + 1);
 
 			if (sel) {
 			   for (i=0; i<listsize; i++)
diff --git a/src/keyboard.c b/src/keyboard.c
index 34fced3d9..c433268a7 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -143,7 +143,6 @@ typedef struct KEY_BUFFER
 static volatile KEY_BUFFER key_buffer;
 static volatile KEY_BUFFER _key_buffer;
 
-static void *key_mutex;
 
 
 /* add_key:
@@ -173,7 +172,12 @@ static INLINE void add_key(volatile KEY_BUFFER *buffer, int key, int scancode)
       }
    }
 
-   system_driver->lock_mutex(key_mutex);
+   buffer->lock++;
+
+   if (buffer->lock != 1) {
+      buffer->lock--;
+      return;
+   }
 
    if ((waiting_for_input) && (keyboard_driver) && (keyboard_driver->stop_waiting_for_input))
       keyboard_driver->stop_waiting_for_input();
@@ -189,7 +193,7 @@ static INLINE void add_key(volatile KEY_BUFFER *buffer, int key, int scancode)
       buffer->end = c;
    }
 
-   system_driver->unlock_mutex(key_mutex);
+   buffer->lock--;
 }
 
 
@@ -202,12 +206,14 @@ void clear_keybuf(void)
    if (keyboard_polled)
       poll_keyboard();
 
-   system_driver->lock_mutex(key_mutex);
+   key_buffer.lock++;
+   _key_buffer.lock++;
 
    key_buffer.start = key_buffer.end = 0;
    _key_buffer.start = _key_buffer.end = 0;
 
-   system_driver->unlock_mutex(key_mutex);
+   key_buffer.lock--;
+   _key_buffer.lock--;
 
    if ((keypressed_hook) && (readkey_hook))
       while (keypressed_hook())
@@ -397,19 +403,12 @@ END_OF_STATIC_FUNCTION(repeat_timer);
  *  which will be used by the main keypressed() and readkey() functions. This
  *  can be useful if you want to use Allegro's GUI code with a custom
  *  keyboard handler, as it provides a way for the GUI to access keyboard
- *  input from your own code. 
+ *  input from your own code.
  */
 void install_keyboard_hooks(int (*keypressed)(void), int (*readkey)(void))
 {
    key_buffer.lock = _key_buffer.lock = 0;
 
-   // since this mode of using the keyboard handler does not have a removal
-   // function, it leaks memory---but at least we can limit the leak to only
-   // a single mutex even if the user calls this function a bunch of times
-   // for some reason.
-   if(!key_mutex)
-      key_mutex = system_driver->create_mutex();
-
    clear_keybuf();
    clear_key();
 
@@ -662,9 +661,6 @@ int install_keyboard(void)
    LOCK_FUNCTION(repeat_timer);
 
    key_buffer.lock = _key_buffer.lock = 0;
-   
-   if(!key_mutex)
-      key_mutex = system_driver->create_mutex();
 
    clear_keybuf();
    clear_key();
@@ -734,11 +730,6 @@ void remove_keyboard(void)
 
    clear_keybuf();
    clear_key();
-   
-   if(key_mutex) {
-      system_driver->destroy_mutex(key_mutex);
-      key_mutex = NULL;
-   }
 
    key_shifts = _key_shifts = 0;
 
diff --git a/src/mouse.c b/src/mouse.c
index 7f9c6a551..96b25b284 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -858,7 +858,7 @@ void set_mouse_range(int x1, int y1, int x2, int y2)
    ASSERT(x1 >= 0);
    ASSERT(y1 >= 0);
    ASSERT(x2 >= x1);
-   ASSERT(y2 >= y1);
+   ASSERT(y2 >= y2);
 
    if (!mouse_driver)
       return;
diff --git a/src/unicode.c b/src/unicode.c
index cd34afd71..da453e1ca 100644
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -737,7 +737,7 @@ int uoffset(AL_CONST char *s, int index)
       }
    }
 
-   return (long)s - (long)orig;
+   return (long long)s - (long long)orig;
 }
 
 
@@ -1783,7 +1783,7 @@ int ustrsize(AL_CONST char *s)
       last = s;
    } while (ugetxc(&s) != 0);
 
-   return (long)last - (long)orig;
+   return (long long)last - (long long)orig;
 }
 
 
@@ -1800,7 +1800,7 @@ int ustrsizez(AL_CONST char *s)
    do {
    } while (ugetxc(&s) != 0);
 
-   return (long)s - (long)orig;
+   return (long long)s - (long long)orig;
 }
 
 
@@ -2313,7 +2313,7 @@ long ustrtol(AL_CONST char *s, char **endp, int base)
    ret = strtol(t, &myendp, base);
 
    if (endp)
-      *endp = (char *)s + uoffset(s, (long)myendp - (long)t);
+      *endp = (char *)s + uoffset(s, (long long)myendp - (long long)t);
 
    return ret;
 }
@@ -2337,7 +2337,7 @@ double ustrtod(AL_CONST char *s, char **endp)
    ret = strtod(t, &myendp);
 
    if (endp)
-      *endp = (char *)s + uoffset(s, (long)myendp - (long)t);
+      *endp = (char *)s + uoffset(s, (long long)myendp - (long long)t);
 
    return ret;
 }
@@ -2948,7 +2948,7 @@ static int decode_format_string(char *buf, STRING_ARG *string_arg, AL_CONST char
 
 	       case 'p':
 		  /* pointer */
-		  slen = sprint_hex(string_arg, &info, FALSE, (unsigned long)(va_arg(args, void *)));
+		  slen = sprint_hex(string_arg, &info, FALSE, (unsigned long long)(va_arg(args, void *)));
 		  NEXT_C();
 		  break;
 
diff --git a/src/win/dllver.rc b/src/win/dllver.rc
index 0a6973d18..a7b04cf00 100644
--- a/src/win/dllver.rc
+++ b/src/win/dllver.rc
@@ -5,8 +5,8 @@
 
 
 1 VERSIONINFO 
-FILEVERSION 4, 4, 4, 0
-PRODUCTVERSION 4, 4, 4, 0
+FILEVERSION 4, 4, 3, 0
+PRODUCTVERSION 4, 4, 3, 0
 FILEOS VOS__WINDOWS32
 FILETYPE VFT_DLL
 BEGIN
@@ -17,12 +17,12 @@ BEGIN
          VALUE "Comments", "Please see AUTHORS for a list of contributors\000"
          VALUE "CompanyName", "Allegro Developers\000\000"
          VALUE "FileDescription", "Allegro\000"
-         VALUE "FileVersion", "4.4.4 (SVN)\000"
+         VALUE "FileVersion", "4.4.3\000"
          VALUE "InternalName", "ALLEG44\000"
          VALUE "LegalCopyright", "Copyright © 1994-2019 Allegro Developers\000\000"
          VALUE "OriginalFilename", "ALLEG44.DLL\000"
          VALUE "ProductName", "Allegro\000"
-         VALUE "ProductVersion", "4.4.4 (SVN)\000"
+         VALUE "ProductVersion", "4.4.3\000"
       END
    END
 
diff --git a/src/win/gdi.c b/src/win/gdi.c
index c40c488c9..c90196a75 100644
--- a/src/win/gdi.c
+++ b/src/win/gdi.c
@@ -198,7 +198,7 @@ static BYTE *get_dib_from_bitmap(BITMAP *bitmap)
    int bpp;
    int x, y;
    int pitch;
-   int col;
+   long col;
    BYTE *pixels;
    BYTE *src, *dst;
 
diff --git a/src/win/wddlock.c b/src/win/wddlock.c
index 91219be96..e3b19318c 100644
--- a/src/win/wddlock.c
+++ b/src/win/wddlock.c
@@ -165,7 +165,7 @@ void gfx_directx_lock(BITMAP *bmp)
       bmp->id |= BMP_ID_LOCKED;
 
       /* update the line array if our parent has moved */
-      pitch = (long)parent->line[1] - (long)parent->line[0];
+      pitch = (long long)parent->line[1] - (long long)parent->line[0];
       data = parent->line[0] +
              (bmp->y_ofs - parent->y_ofs) * pitch +
              (bmp->x_ofs - parent->x_ofs) * BYTES_PER_PIXEL(bitmap_color_depth(bmp));
@@ -263,7 +263,7 @@ void gfx_directx_autolock(BITMAP *bmp)
       }
 
       /* update the line array if our parent has moved */
-      pitch = (long)parent->line[1] - (long)parent->line[0];
+      pitch = (long long)parent->line[1] - (long long)parent->line[0];
       data = parent->line[0] +
              (bmp->y_ofs - parent->y_ofs) * pitch +
              (bmp->x_ofs - parent->x_ofs) * BYTES_PER_PIXEL(bitmap_color_depth(bmp));
diff --git a/src/win/wgdi.c b/src/win/wgdi.c
index 5d173a689..545c5c841 100644
--- a/src/win/wgdi.c
+++ b/src/win/wgdi.c
@@ -524,7 +524,7 @@ static struct BITMAP *gfx_gdi_init(int w, int h, int v_w, int v_h, int color_dep
 
    /* create the screen surface */
    screen_surf = _AL_MALLOC_ATOMIC(w * h * BYTES_PER_PIXEL(color_depth));
-   gdi_screen = _make_bitmap(w, h, (unsigned long)screen_surf, &gfx_gdi, color_depth, w * BYTES_PER_PIXEL(color_depth));
+   gdi_screen = _make_bitmap(w, h, (unsigned long long)screen_surf, &gfx_gdi, color_depth, w * BYTES_PER_PIXEL(color_depth));
    if (!gdi_screen) {
       _TRACE(PREFIX_E "Could not make a bitmap out of the screen surface.\n");	   
       goto Error;
diff --git a/src/win/wkeybd.c b/src/win/wkeybd.c
index 798b0218b..9a8c63397 100644
--- a/src/win/wkeybd.c
+++ b/src/win/wkeybd.c
@@ -689,7 +689,7 @@ static int key_dinput_init(void)
       goto Error;
 
    /* Create the keyboard device */
-   hr = IDirectInput_CreateDevice(key_dinput, &GUID_SysKeyboard, &key_dinput_device, NULL);
+   hr = IDirectInput_CreateDevice(key_dinput, &GUID_SysKeyboardEm2, &key_dinput_device, NULL);
    if (FAILED(hr))
       goto Error;
 
diff --git a/src/win/wmidi.c b/src/win/wmidi.c
index 89b253c6f..dff5f0128 100644
--- a/src/win/wmidi.c
+++ b/src/win/wmidi.c
@@ -242,8 +242,8 @@ int midi_win32_in_init(int input, int voices)
    id = (midi_input_driver->id & 0xFF) - 'A';
 
    /* open midi input device */
-   hr = midiInOpen(&midi_in_device, id, (DWORD)midi_in_proc,
-		   (DWORD)NULL, CALLBACK_FUNCTION);
+   hr = midiInOpen(&midi_in_device, id, (unsigned long long)midi_in_proc,
+		   (unsigned long long)NULL, CALLBACK_FUNCTION);
    if (hr != MMSYSERR_NOERROR) {
       _TRACE(PREFIX_E "midiInOpen failed (%x)\n", hr);
       midi_win32_in_exit(input);
diff --git a/src/win/wmouse.c b/src/win/wmouse.c
index e55631071..e8fed7eeb 100644
--- a/src/win/wmouse.c
+++ b/src/win/wmouse.c
@@ -615,7 +615,7 @@ static int mouse_dinput_init(void)
       goto Error;
 
    /* Create the mouse device */
-   hr = IDirectInput_CreateDevice(mouse_dinput, &GUID_SysMouse, &mouse_dinput_device, NULL);
+   hr = IDirectInput_CreateDevice(mouse_dinput, &GUID_SysMouseEm2, &mouse_dinput_device, NULL);
    if (FAILED(hr))
       goto Error;
 
diff --git a/src/win/wsndwo.c b/src/win/wsndwo.c
index 439eb6c09..60efe3730 100644
--- a/src/win/wsndwo.c
+++ b/src/win/wsndwo.c
@@ -212,7 +212,7 @@ static void digi_waveout_mixer_callback(void)
       if (++digiwobufpos > (digiwobufdivs-1))
          digiwobufpos = 0;
 
-      _mix_some_samples((unsigned long) (digiwobufdata+((digiwobufsize/digiwobufdivs)*digiwobufpos)), 0, TRUE);
+      _mix_some_samples((unsigned long long) (digiwobufdata+((digiwobufsize/digiwobufdivs)*digiwobufpos)), 0, TRUE);
    }
 }
 
@@ -309,7 +309,7 @@ static int digi_waveout_init(int input, int voices)
       goto Error;
    }
 
-   _mix_some_samples((unsigned long) digiwobufdata, 0, TRUE);
+   _mix_some_samples((unsigned long long) digiwobufdata, 0, TRUE);
 
    /* get volume */
    waveOutGetVolume(hWaveOut, &initial_volume);
diff --git a/src/x/xkeyboard.c b/src/x/xkeyboard.c
index b02d7b18f..247fea748 100644
--- a/src/x/xkeyboard.c
+++ b/src/x/xkeyboard.c
@@ -707,7 +707,7 @@ static int x_keyboard_init(void)
 
 #ifdef ALLEGRO_XWINDOWS_WITH_XIM
    /* Otherwise we are restricted to ISO-8859-1 characters. */
-   if (setlocale(LC_CTYPE, "") == NULL) {
+   if (setlocale(LC_ALL, "") == NULL) {
       TRACE(PREFIX_W "Could not set default locale.\n");
    }
 
