(GH-5) Detect properly the end of elements in arrays.