Fixed Sonar violations