agent: FreeBSD related fixes.