Bug fix in output formatting