Got scopes and deactivation working with some tests