Fix minor issues detected by cppcheck