Fixed some minor bugs

The test script had a couple of very minor bugs. I patched them up.

Works fine for all the test cases now.