TaskStats average calculation fixed