Fixed error with entries_by_cls entries being overwritten

So entities_by_cls should be a map from cls to a list of entities, and the type is a defaultdict(list), however, the entries were being overridden, instead of being appended to