Run cppcheck and resolve issues reported

Actually these ones do not really affect lrun.