Synced to upstream revision 1.152