Fix casting warnings.
Merge pull request #1 from sparq/master

Fix cast warnings