workaround special case where the desired key was already present more then once in target file

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>