Add the fix for DISTINCT on table aggregate