Fix orphaned processes with abnormal shutdown