Merge pull request #5315 from ktf/fix-division-by-zero

Avoid division by zero report by static analyzer.
Merge pull request #5450 from cms-sw/CMSSW_7_2_X

Forward port CMSSW_7_2_X into CMSSW_7_3_X