Fix bug in the summation algorithm.

Quick'n'dirty fix for the summation algorithm if the input series don't
have the same number of data points.