Fix errors after automatic refactoring