compatibility fixes for MSVC