Revert "Revert "Merge branch 'static_analysis_fixes'""

This reverts commit 926f9e145c986498f54ecfda7048f16930047342.