Misc fixes.

- Fix possible undefined behavior.
- Fix scram warning.
Merge pull request #3126 from ktf/fix-warning

Misc fixes -- Warnings in DQM/HcalMonitorTasks