Use fold rather than reduce to fix problem where there are no output metrics