Fixes for NullPointerException (see https://github.com/Red-Folder/Cordova-Plugin-BackgroundService/issues/7)