Tightened up test coverage. Fixes #39.