Fixes for MSVC on Windows