FreeBSD build fixes