Pump: add option to handle duplicates in sorted iterators. Fix #253