Changes necessary to compile for iOS

Here are the discussed changes to compile for iOS.