Fix cursor movement