Fixes of Sonar-detected issues.