Improve YAML serialization.