Fix caret position update issues.