Fixed regression added in previous refactoring

This should fix regression reported in #296.