Fixes to MSVC build errors