Fix some 'memory leaks'