Fix some bugs for xcode6