More MSVC C++ compatibility fixes