Fix test cases after refactoring