mingw build fixes