Fix issues in test scripts