ENH: math fixes and typo corrections