agent: Set of fixes missed during merge.

Without these, the FreeBSD port will not compile.