compile fixes for freebsd