Fixes to output formatting