Fixes for suggestions from cppcheck.

8 jobs for master in 2 minutes and 4 seconds (queued for 1 second)