Fix a number of concerns that coverity reports
First will work on the 'addons' portion of the needed work.