Refactoring repair to fix failing test.