Fix bug of insert mode.