Change map.emplace to map.insert