Fix compilation on cygwin
Fix some compiler warnings