Removed few memory leaks