Fix m2m relationship handling in aggregated