Merge "Increase the stability of sorting in the Model."