Fixes for the table creation code