Smaller bug fixes

Hi,

I've replaced CreateHashKey by using EntityKeys and fixed a couple of smaller issues regarding inheritance.