Fix issues causing test suite to fail.

This contains fixes that should correct all of the things causing failures in the test suite.