map_index fix; append_array optimization