Fixed slice_to_box
Fixed write_array