Fix IDF calculation