Make sure that the residues are sorted numerically in the tree.