CPPCheck Fixes

This patch addresses some minor issues flagged by CPPCheck 1.58. Mostly catching exceptions by const reference and iterator pre vs. post increment.