Fix agg state duration computation