cygwin support
fixes for linux from last commit