various msvc build fixes