Scope bug fixes