bug fixes on table creation