Fix test cases, and fix one problem the tests correctly identified.