Fixed some code issues to please Sonar