Fix MSVC build errors