Fix cursor handling #2