Correctly handles empty YAML sections

[skip ci]