Fix: Correctly isolate aggregates from expressions that introduce interior scopes (reduce, fitler, extract, comprehensions)

signed-off-by: Jakub Wieczorek <jakub.wieczorek@neotechnology.com>
Merge pull request #2720 from boggle/2.1-maint

Fix: Correctly isolate aggregates from expressions that introduce interi...