Fixes optimal_index for words with punctuation under 4 characters.