More fixes to test code