Partial conversion/elimination of sort functions.