This fixes #7413.  It is now sorting the arrays before returning them.