HistoricTrend implemented. Corrected a bug in HistoricMean