more freebsd comaptibility fixes