check type before passing to util.table_to_fields
Merge pull request #35 from jrgm/check-type-table

check type before passing to util.table_to_fields