Added explicit casts to remove build warnings. Adding unicode headers not included on OSX/iOS.