Updated plugin so that it doesn't crash

Fixed bug where it would try to unregister a listener that wasn't
registered.
Fixed a bug where on Kevin's phone the JNI would crash due to bad
pointer.