fixes put of duplicate keys and link ordering.