Fix bug in iOS startup routine