Bug fixes for iOS