Fixed tests and checked for missed changes when refactoring