Fix SonarQube issues.

I've thrown the source against my SonarQube instance and did some issue fixing.