Fixed some errors for compatibility with Phonegap 2.5

During the development of an application with PhoneGap 2.5 i tried to get the Push Plugin to work but it crashed the app. I fixed there errors in this Pull Requests but it probably will break compatibility with earlier versions of PhoneGap. So i guess if you think the changes are correct(they worked for me), you should make this the new master and push the former code into a branch or tag so people see that this only works for new versions.