Fix MSVC compilation errors
Fixed compilation errors under different MSVC configurations