Fix variable lookup issues.