[gh-418] Issue 124
Cherry picked old commits from svn test branch.