fixes for issues checked out by coverity

(cherry picked from commit 6f53c4f2f46691d41ccf2c2a99ae40105606e489)

Change-Id: I76e21409fee4f39bd6f048636e4fbc392807a486