Add optional CSV write method to file and small class setter fix