Fix suffix tree construction algorithm.