- Fixed issues reported by Sonar.
- Removed unused code.