Compare arrays correctly