Fix check on exit status in test script