cherry-pick [ecf1243] from master