Fixing sonar issues