This reverts commit c0902959. One of the test cases fails. Revert this until I know a way to make it work reliably.