fix array overflow issues found by David A.

Issues reported at
https://hypernews.cern.ch/HyperNews/CMS/get/swReleases/4108/1/1/1/1/1/1/1/1.html
and follow ups are mostly fixed here. 
just to understand.. isn't the size of the stats array 6 instead of 7?
http://root.cern.ch/root/html/TProfile.html#TProfile:GetStats

thanks,
F.