Corrected calculation of initial value.

Old initial value gave incorrect results for some input.