Emit valid yaml by preventing the ',' if on top level