Updated test script to handle empty output case.