Fixed some bugs for iOS7