Fix retrieving information from object attributes when write out spec