Fix exception when enumerating services