Xcode 6/iOS 8 compatible, code updates and cleanup