Cherry pick one change from the sizenv-refactor branch.