Address review comments and increase test coverage.