Improved error management and sanititization of csv fields