fixed canonization so that the first entry is assumed to be an entity