Fixing some more memory leaks