fixes cppcheck errors
Merge pull request #2 from efernandez/cppcheck

fixes cppcheck errors