Fixing type issues from automatic refactoring