Ref closing sections with indexRef function correctly
Merge pull request #548 from martypdx/issue541

Ref closing sections with indexRef function correctly