Merge of a patch from the old Haddock branch: