Handle case with size == 0 carefully