Update from trinity master branch