Updated to work with ios 8 and new libraries.