Bug fix to summary.txt file function