Merged in feature/issue498 (pull request #267)
This is my copy of the old 498 branch and pull request.
This is my copy of the old 498 branch and pull request.