Fixing some issues Sonar has reported.