memory leak fixes
Merge pull request #2221 from ptraczyk/MT_memleak_fixes

 Reco fixes -- memory leak fixes