Thanks Tim Graham for the review. Backport of 1b823b8f18 from master
1b823b8f18
Regression in 69b7d4b116.
69b7d4b116