Fix miscalculation introduced by early exit (2).