fixing portability issue where longs were different sizes on OSX vs iOS