Fix caret positioning.