various fixes for sonar issues