Fix testing loop