Fixes in output algorithms