Re-commit r166971. I reverted it to quickly, when buildbots didn't have a chance