Fixed bug in table creation