Fixed few memory leaks