Remove some memory leaks
Removes all memory leaks