More fixes for compilation on FreeBSD