Cherry-pick from d8d6f5a