more fixes to rewrite of cursor mode handling