Fix prerm.mm for iOS 8. Based on @zaxdo's patch.