Added search history restoration and fixed cursor.