Prune paths that are ahead of the rest