Add array_pop_back and fix bug