fixed compile errors on Cygwin