Fixed a few sonar violations