Fixed some bugs in the test tools.