Error when instantiating a map with duplicate keys