Downstream testing revealed some problems with this patch. Reverting while investigating. This reverts commit 2b96dceb.