Resolve various Sonar issues