Merge pull request #48 from fotonauts/cast-warnings3

Avoid warning casts
Merge branch 'tengen-master'