Changed interface of optimizer to use OntologyAttributeID instead of OntologyAttribute. This also fixes an issue in the finalization of GenericHistory.