Ensured that state is always set to modified when an entity is modified.
Cleaned out some logging and debugging left behind.