Small fix to array sorting methods