Fix issue where no header prepends "undefined" to output