Clean up cursor handling a little more.