Fix table creation queries