Fix element variable references.