Fix misbehaving cursor