Updates for FreeBSD compatibility