Fixes #5667: correct the compliance computation logic for aggregates