Fix find_longest_substrings.