Fixing some bugs in testing helper scripts.