fixed a minor bug in preprocessing.buildTimeSeries