Updating code to work with the latest release of Xcode 6