Fix wrong cursor position in a certain case pt2