Fixes to agent service discovery

- Handle empty reload command
- Refresh on state changes: necessary to capture ports