iOS future-proofing

Fixes for newer versions of iOS.