Added explicit type casts to avoid warnings when building for 64 bit iOS.