Fix bug introduced in the refactoring