Fixed some issues reported by sonar
Merge pull request #43 from jewzaam/sonar-fixes

Fixed some issues reported by sonar