Fix CompareIntArray for arrays containing duplicate elements