Fixing greedy substrings