Fixed few coverity issues

Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>