Fixed output to only be generated after all files are examined