Fixed various sonar identified code smells

No match.