LeaveTeam changes to implement deletion of team part correctly