Correction to sumout function