Fix table creation order