Fix "medium" and "low" impact coverity false positives outside of tests.