Fixed incorrect variable name and references.