Fixed some memory leaks

Memory leaks are not a good feature. Honestly
Revert "Fixed some memory leaks"

This reverts commit b991c703bd21803f55c5b9440aac776d968d4938.