Prevent infinite loops when iterating over non-arrayish objects.