fixing errors after refactoring ScopeReflection