Minor fixes in entity generation