Fixed bug in new test code