Added compatibility with Cygwin and Windows