[DF-700] Removed debug code
[DF-519] Fixed memory leaks