Bug fix for the previous refactoring.