Cherrypicked b34c