Fix caret positioning in header