some MacOS build fixes
Fix discovery for MacOS