Improve test coverage.

Also fixes issue #60.