Fixed misusage of variables - Dale