Fix assertion error when adding second key