fixed compilation on FreeBSD