Fix some errors and warnings for xcode6