Fix typo in sort.

    We were using the wrong array length.