Improvements based upon Coverity Prevent reports.