Fix possible attribute ref error.