[rt23833] Clean up a number of items identified by the Coverity static analysis tool. Runs courtesy of Red Hat.