fixes to csv2db
merging the fix to csv2db