Fixed bugs with create team and deleting all tasks associated to a deleted team