Fixes some Sonar violations alerts.
Upgrades from Tibor's main branch.