Update the sorting system for all modes.
Still missing the child <=> parent conditions.