Fix some bugs in the schema.