Avoid warning casts
Merge pull request #48 from fotonauts/cast-warnings3

Avoid warning casts