Make code tolerant to empty clusters