Fixed for errors caused by refactoring