Fix some scoping issues.