Fixed misc cppcheck warnings:

- warning about not rethrowing
- added extra parens
- warning about iterator misuse
- unused variable
1 job for cppcheck-fixes2