Minor fix to avoid division by 0