Fixed major bug in array_next