Fix warnings caused by -Wsign-conversion.
Fix warning caused by -Wshadow-ivar.
Merge pull request #23 from jweyrich/master

Fix warnings caused by -Wsign-conversion and -Wshadow-ivar.