Finish the unit test suite and fix a few other small issues in the unit package.