Fix restoring session.