Fixes for broken mingw build.