Fix memory leaks everywhere!