Fixed bug introduced from previous refactoring.