Eliminate static variables from sort functions.