Explicit casts added

XCode/LLVM project fails to compile without those - there seems to be
some aggressive standards-conforming code generation requirement.
Merge pull request #840 from luciderous/master

Explicit casts added