Fix issues for multitenant