fixes for freebsd