Fixed ngram iteration.