Fix discovery

There were some small modification required to make the autodiscovery more user-friendly.