Fixing a few sonar violations.