wrangled memory usage a bit, fix cursor time-out problem