fix some errors on freebsd.