Fix some sonar complaints.