Fixed a bug in internal build_attr_schema function;