Fixes to make test_discovery.py run without errors