Fix the list() bug.

if an object defines __len__ and __iter__, then list(obj) will first
calls __len__ then calls __iter__.
But if we call list(iter(obj)), then __len__ will not be called.
Fix test path bug.