recovery: typechecks, haven't tested.
commented out for pat so a runtime assertion isn't hit (will fix the bug soon).
bug fix.  Still incomplete.