Improvements suggested by CppCheck.
Merge pull request #632 from Morwenn/cppcheck

Improvements suggested by CppCheck.