Apply some cppcheck suggestions