Fix bugs for sharing on iOS 6