Fix for #1001: If the session is dead, do nothing