Fix clang warnings on FreeBSD. Fix a few bugs with the FreeBSD test code. Add two new shared objects.