Fixed a bug with aggregating flows.

Was a index out of bound error.