Bugfix: Aggregate functions
Merge branch 'master' into jaume