Fix incorrect variable references.