This reverts commit 8813b268. This commit will be backported again, this time in sequence, and more closely following the upstream version.