Fixing more errors due to refactoring