Fix possible slicing error