Fixed some code quality issues from Sonar