Adjusted cherry-pick from previous commit