Fixed unit tests after refactoring