Fixed bug in entity expansions