Fixed some more sonar warnings.