Fixes for mingw64.