Use a ScopeGuard to manage _loading_analysis properly.