Fixed Sonar issues