Fix table creation bug