Cherrypicked 99a884c695