Changed from map.at() to map.find() for C++98 compatibility