Fixed a few bugs in averageTSeries. Will need to make similar changes to all of the other functions calling savetSeries.