Fixing Sonar issues