Improved test code as suggested during revision