Fixed code to work with Xcode 6 beta 5 - initial quick and dirty fixes