Fixed some errors on the table creation