Output rendering

Fixed some bugs and formatting in plain (== human-readable) output rendering.