Some mingw compatibility tweaks.