Sort bug fix.