Tenancy and SSO fixes