Added field used to check for entity equality.
Removed obsolete code.