Fix issues with YAMLFactory.copy()