Fix bugs in CollectionUtils#isSorted