Fixed table creation bug