Fix a casting error when updating to cordova-2.0.0