Make executable discovery more robust