Fixing Memory Leaks

Fixing Memory leaks in Classifier