Fix for caret moving