Fix Memory leak, and clear command map after it is deleted.
Add Session and Sequence number verification