Tidied up this test code.