Fix some code smells found with SonarQube.

1 job for master in 8 minutes and 35 seconds (queued for 4 seconds)