Fix variable lookups