Some changes suggested by cppcheck