Modified to match Xcode5 and MacOS 10.10