Bunch of updates to cursor handling