Fix for the refactoring commited yesterday, based on review by Dave Stubbs