[Yaml] Updating #6772 to be more consistent with existing code.