Revert r149110 and add a testcase that was crashing since that revision.