Fixed some memory leaks, also reverted changes caused by unserializer.re recompilation