Attempt to make regression test shell-script a bit more robust.