Improve test script