fix compilation errors on Visual Studio