Cleanup
Small update to discovery code, cleanup
More discovery fixes