Fixing Sonar critical and major issues (when appropriate).