Test and fix FreeBSD support