Fix memory leaks with use of +new.