Added an is_object check in flattenIdentifier as we only want to pass objects to getEntityIdentifier