Adding slightly improved error handling for iOS variants