Prevent crashes when dealing with orphaned programs