Fix automation cursor position issue

Per discussion #1265