Fixed compiler errors and warnings under Cygwin