cygwin compat; fixing errors and warnings with PerlAPI