Few changes to make this compilable on Cygwin