Fixed all warnings and static analyzer errors.
Merge pull request #1 from napoapo77/cleanWarnings

Fixed all warnings and static analyzer errors.