Improvements in function to generate csv tables. Improve #94 and #104