Improved test code.