Minor fix in output function