fixes for cygwin and mingw