Fix compiling issues in cygwin