Backport 439 (YAML serialization fix) to 6.7

Confidently letting Travis have at this while waiting for #440 to get tested and merged.