fixes brought into freebsd