(MSVC) C++ compatibility fixes