Freebsd fixes

Two fixes that gave compilation errors in FreeBSD.