Fix BUG  1222

Determine whether there is increasing array index
Fix BUG  #1222