Added a substantial start on full test coverage.