Fix infinite loop problem

I think I'm going to need a Test::Tester...