Improving cross platform compatibility (prompted by cygwin)