Per #198, the foreach loop.index0 and loop.revindex0 are 0-index, while loop.index and loop.revindex are now 1-indexed.
Merge pull request #226 from thomas-p-wilson/fix-loop-indexing

Foreach loop variable fix per #198