Improve FreeBSD support