Fix error message position and refresh cursor.