FIX infinite loop and test bug