diff --git a/src/s_sound.c b/src/s_sound.c
index 6952b17f244f5a0113652274cc83d89d3fc89353..d108363eb0b962be292f88bad40112626c3601ce 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -1675,7 +1675,7 @@ void S_LoadMusicDefs(UINT16 wadnum)
 	char *lf;
 	char *stoken;
 
-	size_t nlf;
+	size_t nlf = 0xFFFFFFFF;
 	size_t ncr;
 
 	musicdef_t *def = NULL;
diff --git a/src/w_wad.c b/src/w_wad.c
index a8113235465ccb32fc1771fb27f54142aa277677..041222479f0f8b8afee40672efe078583ee6c745 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -76,6 +76,10 @@ int	snprintf(char *str, size_t n, const char *fmt, ...);
 //int	vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
 #endif
 
+#ifdef _DEBUG
+#include "console.h"
+#endif
+
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c
index 42733c30909897d2437387dbe3b6365a096b40d8..f9d66be7ffc57c7f613b85b6a60bf28297b20781 100644
--- a/src/win32/win_sys.c
+++ b/src/win32/win_sys.c
@@ -3199,7 +3199,7 @@ INT32 I_GetKey(void)
 // -----------------
 #define DI_KEYBOARD_BUFFERSIZE 32 // number of data elements in keyboard buffer
 
-void I_StartupKeyboard(void)
+static void I_StartupKeyboard(void)
 {
 	DIPROPDWORD dip;
 
@@ -3435,6 +3435,8 @@ INT32 I_StartupSystem(void)
 	// some 'more global than globals' things to initialize here ?
 	graphics_started = keyboard_started = sound_started = cdaudio_started = false;
 
+	I_StartupKeyboard();
+
 #ifdef NDEBUG
 
 #ifdef BUGTRAP
diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c
index 4e7bab5696d6861350412b47f52b591352da8cde..5fa2195866b08329f02c0057b1aaa6d9f384a977 100644
--- a/src/win32/win_vid.c
+++ b/src/win32/win_vid.c
@@ -56,6 +56,7 @@ static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff,
 static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
 
 boolean highcolor;
+int vid_opengl_state = 0;
 
 static BOOL bDIBMode; // means we are using DIB instead of DirectDraw surfaces
 static LPBITMAPINFO bmiMain = NULL;
@@ -949,7 +950,10 @@ INT32 VID_SetMode(INT32 modenum)
 }
 
 void VID_CheckRenderer(void) {}
-void VID_CheckGLLoaded(rendermode_t oldrender) {}
+void VID_CheckGLLoaded(rendermode_t oldrender)
+{
+	(void)oldrender;
+}
 
 // ========================================================================
 // Free the video buffer of the last video mode,