Fix error, when there were a collection with the same name in distinct group