Use some suggestions from cppcheck