Fix inexact errors.

v0.4 was throwing a couple of `InexactError`s which I think were actually bugs in the implementation. Either way I've fixed them and added a bunch of tests.