fixes to build with msvc