Cleanups and fixes to the tests.