Attempt 2. The first one was trying to call isa<> on an MI reference that was free'd. This reverts commit ee24409c.