fixed more errors in array_set and array_get, moved some conditions around