Fix error with cursor position reporting