Fixed a damn bug in build_attr_schema