Tested and cleaned up check for cygwin