Adds explicit type casts where necessary for ObjC++ compilation
Merge pull request #960 from audun/master

Fixed a few minor compilation errors when using ObjC++