Fixed Memory Leaks