Minor - cleaning code, adding error_logs.
Fixing session cleaning see BT#7407