Fix bugs in TEST.