Add table support to export
Fix errors