fixed bug that would lead to crashes when moving the smart cursor to top or left edges