Fixed calculation for underfull line size.

While here, also renamed various functions and parameters.