Fixes #5565: correct the compliance computation logic for aggregates