Added unit test for table, corrected some errors with table