bugfix in array_pop, array_shift