Fix bugs in iOS app