Fix Markdown output handling