Restore r181216, which was partially reverted in r182499.