Fixed known memory leaks