Fix parents chain with in-memory grouping. Fixes #442