MathUtil bug fix & clean up

First commit is a minor bug fix.

Second commit makes breaking changes as discussed in #150.