Fixed some memory leaks thanks to @chase-san