Fixed sorting of averaged orbits.