Misc mingw fixes