More cleanup and fixed a broken test.