Some code and test cleanup.