Improvements to test runner script.

Test still fails. I'm looking into it.