This reverts commit 3d979f432c. The remaining problems should be fixed by eb3f0aef43.
3d979f432c
eb3f0aef43