Fixing NPE when stopping the service.