Rework earliest and latest functions to support collection arg