MSVC build fixes