Merge "Fix teardown of the identity api"