Code cleanup according to Sonar warnings.