Fixed some problems with csv variable name generation