Revert "Bug fixes from SMTDDR"

This reverts commit 083a45367de50be6e8dfb1dc58c759919400234f.
Redo session_id patch