Fixed infinite loop tests, still more to fix.