Aggregate function fix.
Merge branch 'master' into develop

* master:
  Aggregate function fix.