Some fixes to the get word from caret handler