Fixed a rare issue with numeric overflow when calculating AVG (temporary fix until the staging tables are modified)