Fix critical sonar problems
Fix major sonar issues
Merge pull request #252 from bserdar/sonar-fixes

Sonar fixes