Several FreeBSD related fixes
Several FreeBSD changes/fixes