Remove some redundant code
Fix the build on FreeBSD
Fix a test on FreeBSD
Merge pull request #355 from peternewman/e1.37-2

Remove some redundant code