Add more test coverage and polish.