Fixing issues highlighted by SonarQube