Fix in stub detection and code_discovery