Fix some problems in schema