Fixed misnamed variable. Should result in more useful error messages.