Fixed bug in entity extraction