minor fixes to new scope code