Fix duplicate key indices - #484