Fix three memory leaks.