Fix errors in testing scripts