Fix array sorting.