Corrected a bug with schema generation when relabel_schema is used