Clean up output handling a bit