Fixes issue #186

* Now checks the return type, JSONObject or JSONArray
* If it's a JSONArray we find the original target
* If neither case fits, we drop the value instead of crashing