Take the first element into account when calculating sums, close #1597