More tidying up of the test code