Fix output analysis bugs