Fixed minor bug introduced during refactoring