Fixed a bug in TD-IDF