small fixes to help freebsd