Final changes for FreeBSD support