Fix MSVC compilation errors