Fixed an issue with leaving a team as a team leader.