These casts should fix the warnings on OS X.
Merge pull request #730 from ey6es/master

These casts should fix the warnings on OS X.