Correcting bug introduced during refactoring