Resolve various Sonar warnings