Correctly handle empty array in emitted yaml