bug in count_ngrams (current_d was not recycled) removed, now all tests are passed.