Fixed problem in token sorting.