Improved output handling.