Fix the suffix tree implementation