Fixed usage of getNumberOfCollectionElements: now for maps