Fix a confusing or incorrect calculation and a typo.