Add a test for comment output.
Fix comment output handling.