Fix issues when building with MSVC.