Fix for Javascript errors in Phonegap

This fixed the Javascript errors in my test Phonegap app (executed in the Android simulator); hooking other browsers (Chrome, Firefox, IE6) still works.
Unfortunately, Phonegap hooking still didn't work, so either I did something wrong or there are more problems ahead (see #777).