Fixed some Sonar issues.