Fix traceback in utf output handler