Fixed sonar issues