Fixed a bug in service discovery.

This PR fixes the bug with binaries.