Fixed cursor sometimes not being set.