Fixing bug when creating the tables.