Fix Sonar issues

Fixing multiple sonar issues