Some cygwin fixes for build tool (#6)

Still doesn't work in Cygwin, though.