Fix bug with cursor.