Update from HG changeset 9680:217bdd9a3ad9