Package cleanup and improve test coverage.