Fix probable future memory leaks