Fixed more memory leak issues