Fix some of the many errors with unit tests.