Fix bug where entire tree was not getting copied