Fixed some sonar findings.