Fix leaking dynamic store session object + minor optimizations
Merge pull request #222 from VladimirTechMan/fix_objectleak

Fix leaking dynamic store session object + minor optimizations