Reorganization of different types of agents due to a bug when considering the maximum number of agents per type #18