Apparently the original code seems to work in some cases. It would surely be helpful to give the Xcode version used in each case.