Deal with duplicate keys