Minor scoping fixes