Rewrite get_attribute_value + major bugs corrections