Make unfold use typecase instead of subst.