Weak memory leaks fixed