This reverts commit 46044413. Reverting because it was not the intended version of the patch, which follows this patch.