Fixed some sonar issues