Some Sonar violations fixes