fix misnamed variable lookups