More robust fetch.py script.