Fix cursor placement