Fixes ``QuerySet.aggregate`` invalidation.