Fix cursor position in the UI module