Fix bug not grabbing corresponding script snippet properly.

When I pulled the latest script changes in I noticed a regression where it wasn't pulling the adjacent script tags and just pulled the same .first for every section.