PhoneGap initialization bug fixes