Fix bugs in CommunityGenerator that were causing an infinit loop.