Fixed some issues that SonarQube detected.