Refs #9941. Tried to fix some coverity error.
Merge remote-tracking branch 'origin/bugfix/9941_coverity_datahandling'