Fix for double arrow misalignment in deeply nested arrays.

Addresses #733
I am not so sure about way of detecting end of `foreach` statement