Fixes for mingw-w64