Memory Leak Fixes