Improve code for Cygwin