Issue 124

Cherry picked old commits from svn test branch.