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

Signed-off-by: Koushik Das <koushik@apache.org>