Dmu's fixes, cause github won't let me selectively merge.