[BUGFIX] Ensure that concatenating documents doesn't mutate the originals