Fix msvc build errors