Fixes some Sonar violations alerts.