Fix sonar warnings.