fixed bug on enumeration of items in groups after merging