Fixed regression added in previous refactoring