Fix null reference when creating service.
Version 2.2.16