Rearranged some test code.