Cleanup of Sonar detected issues