Fixes for MSVC