Fix an issue where tool discovery sometimes croaks