Fix some sonar violations