Fixed variable name and missing declaration.