Fix a couple bugs found in the test suite.