Some sonar warnings fixed.