Small bug fixes in the test scripts