Fix collect with internal group (#1936)

Fix github issue #1936 (collect with embedded group)