fix caret insertion. Close #23