Fixed #29 (Cursor outside of table with right)  

This pull request also contains fix of a crash found (9a69a37). Logic and behavior is the same as in #28.