Fixed errors introduced by mass refactoring