Fix msvc compile errors