msvc compiling fixes