Fixed severe bug in sort_echelon