Fix compilation problems on FreeBSD.