Fixed bugs introduced by Xcode 6 beta 4 and changes to Swift.