reinstate sum(itr)
Merge pull request #5643 from lindahua/dh/sumitr

reinstate sum(itr), fix #5642.