Fixed sonar reported issues