Cherrypicked e9a52