Fixed Sonar issues.