Fix bug from last minute refactoring