Fix bugs in some tests.