fix minor bugs in test script