Sonar cleanup

Cleaned up some easy sonar violations.