Corrected repeated headers in output