fixes for mingw64
fix for msvc