Improvements to entity diffing code

Comment doesn't fit any more.