COVERITY: Fixed few coverity issues unused assignments, boxing and unboxing of values etc.

Signed-off-by: Sebastien Goasguen <runseb@gmail.com>