Remove unnecessary code from tests.