Improved getting EntityClass.