Made test.py a bit more robust.