Fix semantic issues flagged by clang
Merge pull request #1 from afofo/master

Fix semantic issues flagged by clang