When comparing string as key for a map, not only the content of the string are compared but also the size of the the string for example.
The following will help you identify the problem :
std::map<std::string, std::string>
std::string key = "KEY";
std::string key2 = "KEY";
key2.resize(100);
now if you mapped something on "KEY" and use key2 to access it, you won't obtain the value yous expected.
jav