Implement some changes suggested by cppcheck.