metadata: changed handling when the same key is used twice