Fix an off-by-one error with computation of partition end.

Alternative fix for bug 127