Visual Studio - fixed various issues when compiling on Windows.