More consistent sorting.

Made the sorting more consistent.