Fixes for FreeBSD.