Added tests for AVG aggregation function. Fixed type errors in ValueDuration