Fixes for msvc