This reverts commit 8bdfcf779f. Should fix #3809. Also needed to make #3290 apply cleanly.
8bdfcf779f