fixes for clang on FreeBSD