Fix broken code from earlier refactoring