Fixing up a bug in the aggregate filtering