Fixed incorrect saving of entity types