Fix null accesses made by UI caused by deleting parts of the program graph.