Fix incomplete backport from trunk