Fixes for SUM, COUNT and INTERSECT expressions