Improved and added tests.

All 261 tests pass. 92% coverage.