Fixed code to close the csv writer
Merge https://github.com/MichaelAHood/fitrep