Fix modifying of map in tf-idf