More robust test cases.

This updates the test classes be better behaved.