Fixes for mingw