Fixed some refactoring leftovers, all tests pass.