Cygwin/Mingw64 fixes