More sophisticated handling for resume_session errors.

Session is now terminated and started over.