Use flag argument to combine copy(nonempty)* routines into copy* routines.