Merge txase's pull request #1 with tests.