Bug fixes and changes for iOS