Revert commit 08297bfb4720be47cdedd8e4578eefe5897b37ad. Needs more testing.