- FOR i IN relation.way_off+1..relation.rel_off LOOP
- IF relation.members[2*i] in ('', 'main_stream') THEN
+ FOR i IN 1..array_upper(relation.members, 1) BY 2 LOOP
+ IF relation.members[i+1] in ('', 'main_stream') AND substring(relation.members[i],1,1) = 'w' THEN